<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/business/include/doctype.jsp" %>
<script>
	var i=1;
	var j=1;
	$(document).ready(function(){
		if(<%= request.getParameter("tog")%> == "1") {
			$('#effect1').show();
			$('#effect2').hide();
			$( "#more1" ).attr('src', "${requestScope.contextPath}/images/reservation/arrow2.gif");
			i++;
		}else if(<%= request.getParameter("tog")%> == "2") {
			$('#effect2').show();
			$('#effect1').hide();
			$( "#more2" ).attr('src', "${requestScope.contextPath}/images/reservation/arrow2.gif");
			j++;
		}else{
			$('#effect1').hide();
			$('#effect2').hide();
		}
	});
	$(function() {
		function runEffect(id) {
			var selectedEffect = "blind";
			var options = {};
			if ( selectedEffect === "scale" ) {
				options = { percent: 0 };
			} else if ( selectedEffect === "size" ) {
				options = { to: { width: 200, height: 60 } };
			}
			$( "#"+id ).toggle( selectedEffect, options, 500 );
		};
		$( "#button1" ).click(function() {
			runEffect("effect1");
			i++;
			if(i%2==0) {
				$( "#more1" ).attr('src', "${requestScope.contextPath}/images/reservation/arrow2.gif");
			}else{
				$( "#more1" ).attr('src', "${requestScope.contextPath}/images/reservation/arrow.gif");
			}
			return false;
		});
		$( "#button2" ).click(function() {
			runEffect("effect2");
			j++;
			if(j%2==0) {
				$( "#more2" ).attr('src', "${requestScope.contextPath}/images/reservation/arrow2.gif");
			}else{
				$( "#more2" ).attr('src', "${requestScope.contextPath}/images/reservation/arrow.gif");
			}
			return false;
		});
	});
</script>

</head>
<body>
	<div id="wrap">
		<div class="header">
			<h1>전사소식</h1>
		</div><!-- // header -->
		<div class="content reservation">		
			<h2 id="button1">회사 게시판<span class="arrow"><img id="more1" src="${requestScope.contextPath}/images/reservation/arrow.gif" alt="" /></span></h2>
			<div class="toggler">
				<div id="effect1" style="display:none">
					<ul class="news">
					<c:forEach items="${mapList}" var="mapInfo" varStatus="status">
						<a href="javascript:goUrl('${requestScope.contextPath}/business/mBoard/boardList.do?strMode=10&BoardCD=${mapInfo.BoardCD}&SortFieldName=SortCreateDate&SortAscDesc=desc&CompanyCode=${CompanyCode }&BoardRootCD=${mapInfo.BoardRootCD}&BoardName=${mapInfo.BoardNameUtf}&BoardRootCDName=${BoardRootCDName1 }&B_IsSub=${mapInfo.B_IsSub}');"><li>${mapInfo.BoardName}
							<c:if test="${mapInfo.B_IsSub != '0'}"> 
							<span class="arrow"><img src="${requestScope.contextPath}/images/board/arrow.gif" alt="" /></span>
							</c:if>
						</li>
						</a>
					</c:forEach>
					</ul>
				</div>
			</div>
		</div><!-- // content -->
		<div class="content reservation">
			<h2 onclick="" id="button2">부서 게시판<span class="arrow"><img id="more2" src="${requestScope.contextPath}/images/reservation/arrow.gif" alt="" /></span></h2>
			<div class="toggler">
				<div id="effect2" style="display:none">
					<ul class="news">
					<c:forEach items="${mapList2}" var="mapInfo2" varStatus="status">
						<a href="javascript:goUrl('${requestScope.contextPath}/business/mBoard/boardList.do?strMode=10&BoardCD=${mapInfo2.BoardCD}&SortFieldName=SortCreateDate&SortAscDesc=desc&CompanyCode=${CompanyCode }&BoardRootCD=${mapInfo2.BoardRootCD}&BoardName=${mapInfo2.BoardNameUtf}&BoardRootCDName=${BoardRootCDName2 }&B_IsSub=${mapInfo2.B_IsSub}');"><li>${mapInfo2.BoardName}
							<c:if test="${mapInfo2.B_IsSub != '0'}"> 
							<span class="arrow"><img src="${requestScope.contextPath}/images/board/arrow.gif" alt="" /></span>
							</c:if>
						</li>
						</a>
					</c:forEach>
					</ul>
				</div>
			</div>
		</div><!-- // content -->
	</div><!-- // wrap -->
	<script>
		window.HybridApp.clearAllHistory(); 
	</script>
</body>
</html>
